#include "StreamGroupFinishedJob.h"
	
namespace GPUCC
{
	StreamGroupFinishedJob::StreamGroupFinishedJob(Scanner& Scanner, BaseScanGroup* Group) : m_Scanner(Scanner), m_Group(Group)
	{
	}

	StreamGroupFinishedJob::~StreamGroupFinishedJob()
	{
	}

	void StreamGroupFinishedJob::Run()
	{
		unsigned int GroupSize = this->m_Group->GetItemsCount();

		this->m_Scanner.m_StreamGroupsCS.Enter();

		this->m_Group->Clear();

		this->m_Scanner.m_StreamGroupsCS.Leave();

		this->m_Scanner.m_StreamGroupsLimits.Release(GroupSize);
	}
}